﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Vds2465Telegrams
{
	[TestClass]
	public class ReportType_General_Test
	{
		[TestMethod]
		[Owner("Frank Eppink")]
		public void Test01_Equals()
		{
			ReportType_General reportTypeGeneral = new ReportType_General(false, eReportSubType_General.Message);

			{
				// completely different type - NOT equal
				object dummyObject = new object();
				Assert.IsFalse(reportTypeGeneral.Equals(dummyObject));
			}

			{
				// same type - same property values
				ReportType_General reportTypeGeneral2compare = new ReportType_General(reportTypeGeneral.OnOffFlag, reportTypeGeneral.ReportSubType);
				Assert.IsTrue(reportTypeGeneral.Equals(reportTypeGeneral2compare));
			}

			{
				// same type - different OnOffFlag
				ReportType_General reportTypeGeneral2compare = new ReportType_General(!reportTypeGeneral.OnOffFlag, reportTypeGeneral.ReportSubType);
				Assert.IsFalse(reportTypeGeneral.Equals(reportTypeGeneral2compare));
			}
			
			{
				// same type - different ReportSubType
				eReportSubType_General reportSubTypeGeneral = eReportSubType_General.Message;
				if (reportTypeGeneral.ReportSubType == eReportSubType_General.Message)
				{
					reportSubTypeGeneral = eReportSubType_General.Revision;
				}
				ReportType_General reportTypeGeneral2compare = new ReportType_General(reportTypeGeneral.OnOffFlag, reportSubTypeGeneral);
				Assert.IsFalse(reportTypeGeneral.Equals(reportTypeGeneral2compare));
			}
		}

		[TestMethod]
		[Owner("Frank Eppink")]
		public void Test02_GetHashCode()
		{
			ReportType_General reportTypeGeneral = new ReportType_General(false, eReportSubType_General.Revision);
			int hashCode01 = reportTypeGeneral.GetHashCode();
		}

		[TestMethod]
		[Owner("Frank Eppink")]
		public void Test03_ToString()
		{
			ReportType_General reportTypeGeneral = new ReportType_General(true, eReportSubType_General.Message);
			string stringResult = reportTypeGeneral.ToString();
			Assert.IsNotNull(stringResult);
		}
	}
}
